

<%@ page contentType="text/html;charset=UTF-8" %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="layout" content="main" />
        <title>股票信息查询</title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><g:link class="list" controller="tools" action="toolList">个人实用工具列表</g:link></span>
        </div>
        <div class="body">
            <h1>股票信息查询</h1>
            <g:form action="doStockInformation" method="post" >
                <div class="dialog">
                    <table>
                        <tbody>
                            <tr class='prop'>
                                <td valign='top' class='name'><label for='stockCode'>股票代码:</label></td>
                                <td valign='top' ><input type="text"  name='stockCode'/>&nbsp;&nbsp;(例如：上证指数 输入:sh000001,深成指 输入：sz399001)
                                </td>
                            </tr>

                        </tbody>
                    </table>
                    <input class="save" type="submit" value="查询股票" />
                </div>
            </g:form>
            <br>
            <g:if test="${stocks == []}">
                请输入股票代码，或者您输入的代码有误请重新输入！！
            </g:if>
            <g:else>
                <div class="list">
                    <table>
                        <thead>
                            <tr>
                                <th>股票名称</th>

                                <th>时间</th>

                                <th>今开盘</th>

                                <th>昨日指数</th>

                                <th>今日指数</th>

                                <th>最高价</th>

                                <th>最低价</th>

                                <th>成交量(手)</th>

                                <th>成交额(元)</th>

                            </tr>
                        </thead>
                        <tbody>
                            <g:each in="${stocks}" status="i" var="stockInstance">
                                <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                                    <td>${fieldValue(bean:stockInstance, field:'stockName')}</td>

                                    <td>${fieldValue(bean:stockInstance, field:'time')}</td>

                                    <td>${fieldValue(bean:stockInstance, field:'open')}</td>

                                    <td>${fieldValue(bean:stockInstance, field:'yesterday')}</td>

                                    <td>${fieldValue(bean:stockInstance, field:'now')}</td>

                                    <td>${fieldValue(bean:stockInstance, field:'high')}</td>

                                    <td>${fieldValue(bean:stockInstance, field:'low')}</td>

                                    <td>${fieldValue(bean:stockInstance, field:'total')}</td>

                                    <td>${fieldValue(bean:stockInstance, field:'money')}</td>
                                </tr>
                                
                            </g:each>
                        </tbody>
                    </table>
                </div>
                <image src="${createLink(controller:"stock", action:"showDailyK",id:params.stockCode)}" height="350" width="550"/>
            </g:else>
        </div>
        
    </body>
</html>
